import { Module } from '@nestjs/common';
import { UserService } from './user.service';
import { UserController } from './user.controller';
import { User } from 'src/entities/user/user.entity';

import { TypeOrmModule } from '@nestjs/typeorm';

import { ConfigService } from '@nestjs/config';

import { JwtAuthStrategy } from "src/common/JWT/jwt-auth.strategy"
import { jwtConstants } from "src/utils/constants"
import { JwtModule } from '@nestjs/jwt';

@Module({
    imports: [
        TypeOrmModule.forFeature([User]),
        JwtModule.register({
            secret: jwtConstants.secret,
            signOptions: { expiresIn: jwtConstants.expiresIn }
        })

    ] /* 安装数据模型 */,
    controllers: [UserController],
    providers: [UserService,
        JwtAuthStrategy
    ],
})
export class UserModule { }
